﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;


public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ////Response.Redirect("/template/default/show.ashx");
        //Common.CssDocument doc = new Common.CssDocument();
        //doc.Load(Server.MapPath("~/style/style.css"));      
        //doc["body"].Attributes["color"] = "#fdfdfd";
        //    //保存CSS文件

        //doc.Save(Server.MapPath("~/style/style.css"));

        string csstxt = Common.FileHelper.ReadFile(Server.MapPath("~/style/style.css"), "utf-8");

        string theattr = "font-size", thecss = "900px";
        StringHelper.UpdateCss(ref csstxt,"div", theattr, thecss);
        StringHelper.UpdateCss(ref csstxt, "body", "width", "940px");
        StringHelper.UpdateCss(ref csstxt, ".gfdha", "width", "90px");

        Common.FileHelper.WriteFile(Server.MapPath("~/style/style.css"), csstxt, "utf-8");

        //Response.Write(m.Value.ToString());
        //Response.End();            
    }
}
